/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		ScriptHelper.h

					E-mail:		arise_engine@mail.ru

created:			27.01.2008
last changes:		27.01.2008
*****************************************************************************************/
#pragma once

//#define DEBUG_SCRIPT_BIND	//	debug inner states


class ScriptBinder
{
private:

	int ref_count;

	#ifdef DEBUG_SCRIPT_BIND
		int object_id; 
	#endif

public:		
	
	ScriptBinder();

	virtual void AddRef();
	virtual void Release();
};


struct ScriptTest: public ScriptBinder
{
	int a;
	void b(int v)			{a += v;}
	ScriptTest* Factory()	{return new ScriptTest();}

	/*//	script source example
	
		void main()
		{
			test@ r = Create();
			r.a = 5;
			dump(r.a);	
			r.b(11);
			msg("r.a " + r.a);

			test t;
			t.a = 19;
			dump(t.a);

			test@ v = @t;
			dump(v.a);
		}
	*/
};

ScriptTest* Create();

void msg_color(int color, const std::string& msg);
void msg(const std::string& msg);
void dump_int(int value);
void dump_float(float value);
